<?php
$CI =& get_instance();
$sBasePath = public_base_url().'js/fckeditor/' ;
?>
<h2>Template Home page</h2>
<div class="content-inner">
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">
		<tbody>
		    <tr>
		      <th colspan="3" class="label">Template Name:</th>
			</tr>
		    <tr>
		      <td colspan="3"><input type="text" name="item_name" class="input-text required" value="<?=$ed['name']?>"></td>
		    </tr>
			<tr>
		      <th colspan="3" class="label">Title:</th>
			</tr>
		    <tr>
		      <td colspan="3"><input type="text" name="item_title" class="input-text required" value="<?=$ed['title']?>"></td>
		    </tr>
		    <tr>
		      <th class="label">Left Column: News &amp; Events</th>
			  <th class="label">Center Content</th>
			  <th class="label">Right Column: Documents</th>
		    </tr>
			<tr>
				<td>
					<?php $t1 = unserialize($ed['t1']);?>
					<p><label>Title: </label><input type="text" name="t1_title" class="input-text" value="<?=$t1['title']?>"/></p>
					<p><label>Group: </label>
						<select name="t1_group" class="input-text">
							<option value="">Please select</option>
							<?php foreach($newsgroups as $item):?>
							<option value="<?=$item['id']?>" <?=$t1['group']==$item['id'] ? "selected='true'" : ""?>><?=$item['name']?></option>
							<?php endforeach;?>
						</select>
					</p>
					<p><label>Number: </label><input type="text" name="t1_number" class="input-text" value="<?=$t1['number']?>"/></p>
				</td>
				<td>
					<?php $t2 = unserialize($ed['t2']);?>
					<p><label>Title: </label><input type="text" name="t2_title" class="input-text" value="<?=$t2['title']?>"/></p>
					<p><label>Content: </label>
						<?=$this->ckeditor->editor("t2_content", $t2['content'], array("baseHref" => site_url()));?>
					</p>
				</td>
				<td>
					<?php $t3 = unserialize($ed['t3']);?>
					<p><label>Title: </label><input type="text" name="t3_title" class="input-text" value="<?=$t3['title']?>"/></p>
					<p><label>Group: </label>
						<select name="t3_group" class="input-text">
							<option value="">Please select</option>
							<?php foreach($datagroups as $item):?>
							<option value="<?=$item['id']?>" <?=$t3['group']==$item['id'] ? "selected='true'" : ""?>><?=$item['name']?></option>
							<?php endforeach;?>
						</select>
					</p>
					<p><label>Number: </label><input type="text" name="t3_number" class="input-text" value="<?=$t3['number']?>"/></p>
				</td>
			</tr>
		    <tr>
		      <td colspan="3">
		        <input type="hidden" name="id" value="<?=$ed['id']?>" />
		        <input type="hidden" name="item_main" value="<?=$nav['id']?>" />
		        <input type="hidden" name="item_temp" value="<?=$nav['temp']?>" />
		        <input name="Submit" type="submit" class="ins" value="Save" />
		      </td>
		    </tr>
		</tbody>
	</table>
</div>